<%@page import="java.sql.*" %>

<%
 
try
 {
 
        Class.forName("oracle.jdbc.driver.OracleDriver");

         Connection con=DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:xe","pac","mca"); 

         Statement stmt=con.createStatement();
  
  ResultSet rs=stmt.executeQuery("select company_name from company_register");
  while(rs.next())
  {
   String str=rs.getString(1);
  
   %>

  <option value=<%=str %>><%=str %></option>

  <% 
  }
  }
  catch(Exception e){
  %> <option> error</option> <%
  }
  
  %>
   
  
